package us.icitap.cm.business.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Id;

@Embeddable
public class EntityEntityAssocId implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 8513878725950293965L;

	@Id
	private Integer reportId;
	
	@Id
	private Integer entityOneId;
	
	@Id
	private Integer entityTwoId;
	
	@Id
	private Integer associationTypeId;


	public Integer getEntityOneId() {
		return entityOneId;
	}

	public void setEntityOneId(Integer entityOneId) {
		this.entityOneId = entityOneId;
	}

	public Integer getEntityTwoId() {
		return entityTwoId;
	}

	public void setEntityTwoId(Integer entityTwoId) {
		this.entityTwoId = entityTwoId;
	}

	public Integer getAssociationTypeId() {
		return associationTypeId;
	}

	public void setAssociationTypeId(Integer associationTypeId) {
		this.associationTypeId = associationTypeId;
	}

	public Integer getReportId() {
		return reportId;
	}

	public void setReportId(Integer reportId) {
		this.reportId = reportId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((associationTypeId == null) ? 0 : associationTypeId
						.hashCode());
		result = prime * result
				+ ((entityOneId == null) ? 0 : entityOneId.hashCode());
		result = prime * result
				+ ((entityTwoId == null) ? 0 : entityTwoId.hashCode());
		result = prime * result
				+ ((reportId == null) ? 0 : reportId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EntityEntityAssocId other = (EntityEntityAssocId) obj;
		if (associationTypeId == null) {
			if (other.associationTypeId != null)
				return false;
		} else if (!associationTypeId.equals(other.associationTypeId))
			return false;
		if (entityOneId == null) {
			if (other.entityOneId != null)
				return false;
		} else if (!entityOneId.equals(other.entityOneId))
			return false;
		if (entityTwoId == null) {
			if (other.entityTwoId != null)
				return false;
		} else if (!entityTwoId.equals(other.entityTwoId))
			return false;
		if (reportId == null) {
			if (other.reportId != null)
				return false;
		} else if (!reportId.equals(other.reportId))
			return false;
		return true;
	}




}
